<template>
	<view class="search-container">
		<view class="header">
			<view class="search-bar">
				<image class="price" src="../../../static/搜索.png"></image>
				<input class="input" type="text" placeholder="搜索" v-model="searchText" />
			</view>
			<view class="search-btn" @click="search">
				搜索
			</view>
		</view>
		<view class="order-list">
			<view class="order-item" v-for="order in orders" :key="order.id">
				<view class="order-details">
					<text class="order-title">{{ order.title }}</text>
					<text class="order-user">下单用户: {{ order.user }}</text>
					<text class="order-amount">支付金额: ￥{{ order.amount }}</text>
					<text class="order-time">核销时间: {{ order.time }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchText: '',
				orders: [
					{ id: 1, title: '普通洗车, 机油, 工时', user: '张三', amount: '32.00', time: '2022-10-12 11:09' },
					{ id: 2, title: '普通洗车, 机油, 工时', user: '张三', amount: '32.00', time: '2022-10-12 11:09' },
					{ id: 3, title: '普通洗车, 机油, 工时', user: '张三', amount: '32.00', time: '2022-10-12 11:09' },
					{ id: 4, title: '普通洗车, 机油, 工时', user: '张三', amount: '32.00', time: '2022-10-12 11:09' },
					// 继续添加更多订单
				]
			};
		},
		methods: {
			search() {
				console.log('Searching for:', this.searchText);
			}
		}
	};
</script>

<style>
	.search-container {
		width: 100%;
		box-sizing: border-box;
	}

	.header {
		display: flex;
		align-items: center;
		background-color: #EFEFF5;
		width: 100%;
		padding: 10px;
		/* 去掉外边距 */
		box-sizing: border-box;
	}

	.price {
		width: 12px;
		height: 12px;
		margin-left: 130px;
	}

	.search-bar {
		display: flex;
		align-items: center;
		background-color: #FFFFFF;
		border: 1px solid #ccc;
		border-radius: 7px;
		flex: 1;
		margin-right: 10px;
		padding: 0 10px;
		box-sizing: border-box;
	}

	.input {
		flex: 1;
		border: none;
		outline: none;
		padding-left: 5px;
	}

	.search-btn {
		color: #007AFF;
		font-size: 16px;
		cursor: pointer;
	}

	.order-list {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.order-item {
		width: 90%;
		background-color: #fff;
		border: 1px solid #ccc;
		border-radius: 5px;
		margin-bottom: 10px;
		padding: 10px;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	}

	.order-details {
		display: flex;
		flex-direction: column;
	}

	.order-title,
	.order-user,
	.order-amount,
	.order-time {
		margin-bottom: 5px;
		color: #333;
	}

	.order-title {
		font-weight: bold;
	}

	.order-time {
		color: #666;
	}
</style>
